import React, { useContext } from 'react'
import GlobalContext from './Context'
export default function Child1() {
  const { dispatch } = useContext(GlobalContext)
  return (
    <div>
      <button
        onClick={() =>
          dispatch({
            type: 'child2',
            payload: 'child2',
          })
        }
      >
        child2
      </button>
      <button
        onClick={() =>
          dispatch({
            type: 'child3',
            payload: 'child3',
          })
        }
      >
        child3
      </button>
    </div>
  )
}
